//-----------------------------------------------------------------------
// <copyright file="GeneralSetting.cs" company="Yokogawa">
//      Copyright (c) 2011 Yokogawa.
//      All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

using System.Runtime.Serialization;

namespace TestFramework.Config
{
    using System;

    /// <summary>
    /// Operation Mode Enum
    /// </summary>
    /// <remarks></remarks>
    [DataContract]
    public enum OperationModeEnum
    {
        /// <summary>
        /// Tapping Normal Mode
        /// </summary>
        [EnumMember]
        TappingNormal,

        /// <summary>
        /// Tapping Local Mode
        /// </summary>
        [EnumMember]
        TappingLocal
    }

    /// <summary>
    /// General Setting
    /// </summary>
    /// <remarks></remarks>
    public class PropertySource : ICloneable
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertySource"/> class.
        /// </summary>
        /// <remarks></remarks>
        public PropertySource()
        {
            this.SVTriggerTimer = 5000;
            this.OBSTriggerTimer = 200;
            this.HSMSCheckTimer = 10000;
            this.TransformationSupport = true;
            this.OperationMode = OperationModeEnum.TappingNormal;
            this.OnlineRemoteEventCEID = 45;
            this.S2F18MessageFormat = "16bytes";
            this.OnlineRemoteEventACKC6 = 55;
            this.DateTimeFormat = "yyyyMMddHHmmssff";
            this.EAOperationMode = "PASSTHROUGH";
            this.SessionPingInterval = "60";
        }

        /// <summary>
        /// Gets or sets the SV trigger timer.
        /// </summary>
        /// <value>The SV trigger timer.</value>
        /// <remarks></remarks>
        public int SVTriggerTimer { get; set; }

        /// <summary>
        /// Gets or sets the OBS trigger timer.
        /// </summary>
        /// <value>The OBS trigger timer.</value>
        /// <remarks></remarks>
        public int OBSTriggerTimer { get; set; }

        /// <summary>
        /// Gets or sets the HSMS check timer.
        /// </summary>
        /// <value>The HSMS check timer.</value>
        /// <remarks></remarks>
        public int HSMSCheckTimer { get; set; }

        /// <summary>
        /// Gets or sets a value indicating whether [transformation support].
        /// </summary>
        /// <value><c>true</c> if [transformation support]; otherwise, <c>false</c>.</value>
        /// <remarks></remarks>
        public bool TransformationSupport { get; set; }

        /// <summary>
        /// Gets or sets the operation mode.
        /// </summary>
        /// <value>The operation mode.</value>
        /// <remarks></remarks>
        public OperationModeEnum OperationMode { get; set; }

        /// <summary>
        /// Gets or sets the online remote event CEID.
        /// </summary>
        /// <value>The online remote event CEID.</value>
        /// <remarks></remarks>
        public ulong OnlineRemoteEventCEID { get; set; }

        /// <summary>
        /// Gets or sets the s2 F18 message format.
        /// </summary>
        /// <value>The s2 F18 message format.</value>
        /// <remarks></remarks>
        public string S2F18MessageFormat { get; set; }

        /// <summary>
        /// Gets or sets the online remote event ACK c6.
        /// </summary>
        /// <value>The online remote event ACK c6.</value>
        /// <remarks></remarks>
        public int OnlineRemoteEventACKC6 { get; set; }

        /// <summary>
        /// Gets or sets the date time format.
        /// </summary>
        /// <value>The date time format.</value>
        /// <remarks></remarks>
        public string DateTimeFormat { get; set; }

        /// <summary>
        /// Gets or sets the date time format.
        /// </summary>
        /// <value>The date time format.</value>
        /// <remarks></remarks>
        public string EAOperationMode { get; set; }

        public string SessionPingInterval { get; set; }

        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        /// <returns>A new object that is a copy of this instance.</returns>
        /// <remarks></remarks>
        public object Clone()
        {            
            var clone = (PropertySource)this.MemberwiseClone();
            return clone;
        }
    }
}